Skip to content

update formatter to handle record closing braces correctly#8106

Merged
mbien merged 1 commit intoapache:masterfrom
mbien:record-formatter-closing-brace-fix2
Jan 5, 2025
Merged

update formatter to handle record closing braces correctly#8106
mbien merged 1 commit intoapache:masterfrom
mbien:record-formatter-closing-brace-fix2

Conversation

@mbien
Copy link
Member

@mbien mbien commented Jan 2, 2025

alternative to #8101 contributed by @homberghp,

rebased and moves the new regression test to FormattingTest.

  • adds tests to show the error
  • adds inner and outer record in ui template text for setting java format spaces
  • solves the error by moving spaces(cs.spaceWithinMethodDeclParens() ? 1 : 0, true); to the correct place.

fixes #7043

…ition

 - adds tests to show the error
 - adds inner and outer record in ui template text for setting java
   format spaces
 - solves the error by moving spaces(cs.spaceWithinMethodDeclParens() ? 1 : 0, true);  to the correct place.

Co-authored-by: Michael Bien <mbien42@gmail.com>
@mbien mbien added Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) labels Jan 2, 2025
@mbien mbien added this to the NB25 milestone Jan 2, 2025
Copy link
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change from @homberghp makes sense and the new test and the existing still working record formatting test indicate that this is a safe change.

I also agree that it is more in line with the rest of the module that the test is integrated into FormatingTest.

@homberghp @mbien thank you both.

@mbien mbien merged commit 8475069 into apache:master Jan 5, 2025
36 checks passed
@mbien mbien mentioned this pull request Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reformat of record wrongly indents closing brace

3 participants

Comments